package com.mycompany.myapp.web.rest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 实现自动刷新
 * @author yifeng
 */
@RestController
@RequestMapping("/api")
@RefreshScope
public class RefreshResource {
    @Value("${foo.name: foo name default}")
    public String fooName;

    @GetMapping("/foo-name")
    public String getFooName() {
        return this.fooName;
    }
}
